
%define KORG 0x1200

; DIRECTORIOS DE PAGINAS

	; DIRECTORIO DE PAGINAS PINTOR

		TIMES 0xA000 - KORG - ($ - $$) db 0x0

		page_dir_pintor:		; 1024 entradas
		%rep	0x400
			dd	0x00000002		;supervisor, read/write, not present
		%endrep

	; DIRECTORIO DE PAGINAS KERNEL

		TIMES 0xB000 - KORG - ($ - $$) db 0x0

		page_dir_kernel:		; 1024 entradas
		%rep	0x400
			dd	0x00000002		;supervisor, read/write, not present
		%endrep

; TABLAS DE PAGINAS

	; TABLA DE PAGINAS 0 PINTOR

		TIMES 0xC000 - KORG - ($ - $$) db 0x0

		page_table_pintor_0:	; 1024 entradas

		; identity mapping de 0x0000 -> 0x8FFF

		%assign i 0x0000
		%rep 9
			dd 	i | 3			;supervisor, read/write, present
			%assign i i+0x1000
		%endrep

		; relleno del 0x9000 -> 0xDFFF

		%rep 5
			dd 	0x00000002
		%endrep

		; identity mapping de 0xE000 -> 0xFFFF

		dd 0xE000 | 3

		dd 0xF000 | 3

		; relleno del 0x10000 -> 0x12FFF

		dd 	0x00000002			;supervisor, read/write, not present
		dd 	0x00000002			;supervisor, read/write, not present
		dd 	0x00000002			;supervisor, read/write, not present

		; mapeo 0x13000 -> 0x13FFF a 0xB8000 -> 0xB8FFF

		dd 0xB8000 | 3

		; relleno del 0x14000 -> 0x14FFF

		dd 	0x00000002			;supervisor, read/write, not present

		; identity mapping de 0x15000 -> 0x15FFF

		dd 	0x15000 | 3			;supervisor, read/write, present

		; relleno del 0x16000 -> 0xB7FFF

		%rep 0xA2
			dd 	0x00000002
		%endrep

		; mapeo 0xB8000 -> 0xB8FFF a 0x10000 -> 0x10FFF

		dd 0x10000 | 3

		; relleno del 0xB9000 -> 0x400FFF

		%rep 0x347
			dd 	0x00000002
		%endrep

	; TABLA DE PAGINAS 0 KERNEL

		TIMES 0xD000 - KORG - ($ - $$) db 0x0

		page_table_kernel_0:	; 1024 entradas

		; identity mapping de 0x0000 -> 0x7FFF

		%assign i 0x0000
		%rep 8
			dd 	i | 3			;supervisor, read/write, present
			%assign i i+0x1000
		%endrep

		; relleno del 0x8000 -> 08FFF

		dd	0x00000002			;supervisor, read/write, not present

		; identity mapping de 0x9000 -> 0x10FFF

		%assign i 0x9000
		%rep 8
			dd 	i | 3			;supervisor, read/write, present
			%assign i i+0x1000
		%endrep

		; relleno del 0x11000 -> 0x12FFF

		dd 	0x00000002			;supervisor, read/write, not present
		dd 	0x00000002			;supervisor, read/write, not present

		; mapeo 0x13000 -> 0x13FFF a 0xB8000 -> 0xB8FFF

		dd 0xB8000 | 3

		; relleno del 0x14000 -> 0x15FFF

		dd 	0x00000002			;supervisor, read/write, not present
		dd 	0x00000002			;supervisor, read/write, not present

		; identity mapping de 0x16000 -> 0x16FFF

		dd 0x16000 | 3

		; relleno del 0x17000 -> 0x17FFF

		dd	0x00000002			;supervisor, read/write, not present

		; mapeo 0x18000 -> 0x18FFF a 0xB8000 -> 0xB8FFF

		dd 0xB8000 | 3

		; relleno del 0x19000 -> 0x9FFFF

		%rep 0x87
			dd 	0x00000002		;supervisor, read/write, not present
		%endrep

		; identity mapping de 0xA0000 -> 0xBFFFF

		%assign i 0xA0000
		%rep 0x20
			dd 	i | 3			;supervisor, read/write, present
			%assign i i+0x1000
		%endrep

		; relleno del 0xC0000 -> 0x400FFF

		%rep 0x341
			dd 	0x00000002
		%endrep
